import { Swiper, Image } from 'antd-mobile'
import { itemType } from './type'

const Banner = (props: {banner: []}) => {
  return (
    <Swiper autoplay={true} loop={true} autoplayInterval={2000}>
      {props.banner.map((item: itemType) => {
        return (
          <Swiper.Item key={item.id}>
            <Image src={item.img_url} height={160}/>
          </Swiper.Item>
        )
      })}
    </Swiper>
  )
}

export default Banner